--[[/**
-- * 
 * 增加能量
 *
-- *
-- */]]

---@class BuffEffect242101 : BaseBuffEffect
BuffEffect242101 = ClientFight.CreateClass("BuffEffect242101", ClientFight.BaseBuffEffect)
local t = BuffEffect242101

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local skill = buff.skill;
    local target = buff.target;

    local energy = skill.parentSkill.parameters[BuffEffect242100.BUFF_EFFECT_242100_ENERGY] or 0;
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
            .. buff.modelId .. " 抽取对方能量加给友方 : " .. energy);
    FighterManager.addEnergy(fight, target, skill.skillModelId, skill.frame, energy, EnergyChangeReasonEnum.BUFF);
    local addHp = skill.parentSkill.parameters[BuffEffect248100.BUFF_EFFECT_248100_ADDHP] or 0;
    if (addHp > 0) then
        SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
                .. buff.modelId .. " 额外抽取血量给友方 : " .. addHp);
        DamageManager.setFighterHp(fight, target, buff.source, nil, DamageResultTypeEnum.HEAL, addHp
        , target.hp + addHp, true, false, true);
        return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
    end
end
t.New()